package com.jms.fu.model.bo;

import java.util.Date;
import java.util.List;

import com.jms.fu.exception.DAOException;
import com.jms.fu.model.bean.Project;
import com.jms.fu.model.dao.ProjectDAO;

public class ProjectBO {
	ProjectDAO projectDAO;

	public void createNewProject(String name, String managerId, String datecreate) throws DAOException {
		projectDAO = new ProjectDAO();
		projectDAO.createNewProject(name,managerId,datecreate);
		
	}

	public boolean checkName(String name) throws DAOException {
		projectDAO = new ProjectDAO();
		return projectDAO.checkName(name);
		
	}

	public List<Project> getProjectByManager(String username) throws DAOException {
		projectDAO = new ProjectDAO();
		return projectDAO.getProjectByManager(username);
	}

	public void closeProject(String projectId) throws DAOException{
		projectDAO = new ProjectDAO();
		projectDAO.closeProject(projectId);
		
	}

	public void assignMember(String username, String projectId) throws DAOException {
		projectDAO = new ProjectDAO();
		projectDAO.assignMember(username,projectId);
		
	}

	public void kickOut(String username) throws DAOException {
		projectDAO = new ProjectDAO();
		projectDAO.kickOut(username);
	}
}
